import request from '@/utils/request'

export function getPage(data) {
  return request({
    url: `/school/page?schoolName=${data.schoolName}&page=${data.page}&limit=${data.limit}`,
    method: 'get' // query
  })
}

export function addSchool(data) {
  return request({
    url: `/school/addSchool`,
    method: 'post',
    data: data // body
  })
}

export function addSchoolByTemplate(data) { // 上传文件
  return request({
    url: `/school/addSchoolByTemplate`,
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: data // body
  })
}

export function updateSchool(data) {
  return request({
    url: `/school/updateSchool`,
    method: 'post',
    data: data
  })
}

export function deleteSchool(data) {
  return request({
    url: `/school/deleteSchool?schoolId=${data.schoolId}`,
    method: 'post'
  })
}

export function deleteSchools(data) {
  return request({
    url: `/school/deleteSchools?schoolIds=${data.item}`,
    method: 'post'
  })
}
